.<template>
	<view style="">
		<!--  #ifdef  H5 -->
		<!-- <image :src="$util.img(room_img)?room_img:'../../../../static/download/bgi.png' "  mode="aspectFill" class="back-img" style=""></image> -->
		<image :src="$util.img('/upload/uniapp/live/livebg.png') "  mode="aspectFill" class="back-img" style=""></image>
		<!--  #endif -->
		<!--  #ifdef  APP-PLUS -->
		<!-- <image :src="room_img?room_img:'../../../../static/download/bgi.png'"  mode="aspectFill" class="back-img" style=""></image> -->
		<image :src="$util.img('/upload/uniapp/live/livebg.png') "  mode="aspectFill" class="back-img" style=""></image>
		<!--  #endif -->
		<!-- 头像 -->
		<view class="exit" @click="exit()">
			<uni-icons type="arrowleft" size="30" color="#FFFFFF"></uni-icons>
		</view>
		<!-- <view class="header-box">
			<image :src="infoList.liver_head" mode=""></image>
			<view class="info-text">
				<view>{{infoList.shop_name}}</view>
				<view>{{people_number}}人 观看</view>
			</view>
		</view> -->
		<!-- 直播 -->
		<view class="center">
			<text class="fin-text">直播已结束</text>
			<!-- <text class="time-text" style="color: #CEA1A4;">直播时长 {{time}}</text> -->
			<text></text>
			<view class="data-list">
				<view class="data-item" style="color: #000000;">
					<view class="data">
						<text>{{people_number}}</text>
						<text>人</text>
					</view>
					<view class="data-list-text">
						观看
					</view>
				</view>
				<view class="data-item-null">
					
				</view>
				<view class="data-item" style="color: #000000;">
					<view class="data">
						<text>{{comment_number}}</text>
					</view>
					<view class="data-list-text">
						评论
					</view>
				</view>
				<view class="data-item-null">
				</view>
				<view class="data-item" style="color: #000000;">
					<view class="data">
						<text>0</text>
					</view>
					<view class="data-list-text">
						赞
					</view>
					
				</view>
			</view>
		</view>
		<!-- 商品列表 -->
		<view class="goodsList" v-if="goodsList.length > 0">
			<view class="goods-title">
				<!-- <text>直播商品 {{goodsList.length}}</text> -->
				<text>直播商品 {{goodsList.length}}</text>
				<!-- <text class="goods-title-num"></text> -->
			</view>
			<view class="goods-items">
				<view class="goods-item" v-for="(goodsitem,goodsindex) in goodsList" :key="goodsindex">
					<image :src="goodsitem.sku_image" mode=""></image>
					<view class="goods-item-r">
						<text class="goods-item-title">{{goodsitem.sku_name}}</text>
						<view class="goods-item-price">
							<text>{{goodsitem.unit}} {{goodsitem.price}}</text>
						</view>
					</view>
					
				</view>
				
			</view>
			<view class="" style="height: 100rpx;"></view>
		</view>
	
		<button class="footer-btn" type="default" @click="goback">返回首页</button>
	</view>
</template>

<script>
	import uniIcons from "@/components/uni-icons/uni-icons.vue"
	export default {
		 components: {uniIcons},	
		data() {
			return {
				time:'01:26:37',
				img:'',
				goodsList:[
					
				],
				infoList:[],
				roomID:0,//房间号
				people_number:0,
				comment_number:0,//评论数
				room_img:''
			}
		},
		onUnload() {
		},
		onLoad(option) {
			setTimeout(()=>{
				this.roomInfos()
				this.exitLive()
			},500)
			this.roomID =  option.roomID
			
		},
		created() {
		},
		onShow() {
		},
		methods: {
			// 商品信息
			roomInfos() {
			 
				let roomID = this.roomID
			 
				this.$api.sendRequest({
					url: '/api/Memberliveplay/roomInfo',
					data: {
						 roomid: this.roomID
					},
					success: res => {
						 
						this.infoList = res
						this.goodsList = res.goods_info
					}
				})
 
			},	
			
			// 流量
			exitLive(){
			 
				this.$api.sendRequest({
					url: '/api/Memberliveplay/exitLive',
					data: {
						 roomid: this.roomID
						 // roomid: '161'
					},
					success: res => {
						 
						this.people_number = res.people_number
						this.room_img = res.room_img
						this.comment_number = res.comment_number ?res.comment_number :0;
					}
				})
			},
			
			// exit
			exit(){
				uni.redirectTo({
					url: '/pages/member/index/index'
				});
			} ,
			
			goback(){
				uni.redirectTo({
					url: '/pages/member/index/index'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.back-img{
		width: 100vw; 
		height: 100vh; 
		padding: 0!important;
		margin: 0!important; 
		position: absolute;
		top: 0;
		left: 0;
		filter: blur(2px);
	}
	text{
		color: #FFFFFF;
	}
	
	view{
	}
	.footer-btn{
		width: 414rpx;
		height: 91rpx;
		color: #FFFFFF;
		background: linear-gradient(93deg, #F80525 0%, #F84723 100%);
		// background: linear-gradient(to right, #F80525 0%, #F84723 100%);
		border-radius: 46rpx;
		position: absolute;
		bottom: 50rpx;
		left: 14%;
		text-align: center;
		line-height: 91rpx;
	}
	.exit{
		width: 14rpx;
		height: 26rpx;
		color: #FFFFFF;
		position: absolute;
		left: 8rpx;
		top: 80rpx;
		uni-icons{
			width: 100%;
			height: 100%;
		}
	}
	.header-box{
		width: 240rpx;
		height: 77rpx;
		// background: linear-gradient(96deg, #000000 40%, #000000 100%);
		// opacity: 0.4;
		background-color: rgba(0,0,0,0.39)!important;
		border-radius: 39rpx;
		display: flex;
		box-sizing: border-box;
		margin-right: 15rpx;
		position: absolute;
		left: 77rpx;
		top: 97rpx;
		image{
			width: 67rpx;
			height: 67rpx;
			border-radius: 50%;
			box-sizing: border-box;
			margin: 4rpx 8rpx 6rpx 7rpx;
		}
		
		.info-text{
			display: flex;
			flex-direction: column;
			view{
				font-size: 28rpx;
				font-weight: 500;
				color: #FFFFFF;
				height: 27rpx;
				line-height: 27rpx;
				padding: 7rpx;
			}
		}
	}

	.center{
		box-sizing: border-box;
		padding: 94rpx 58rpx;
		padding-top: 268rpx;
		height: 600rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		.fin-text{
			font-size: 50rpx;
			font-weight: bold;
		}
		.time-text{
			font-size: 28rpx;
			font-weight: 500;
			color: #FFFFFF;

		}
		
		.data-list{
			width: 633rpx;
			height: 183rpx;
			background-color: rgba(0,0,0,0.5);
			background-color: rgba(0,0,0,0.39)!important;
			border-radius: 10px;
			display: flex;
			align-items: center;
			margin-top: 68rpx;
			margin-bottom: 42rpx;
			padding: 50rpx 0;
			.data-item{
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
			}
			.data-item-null{
				width: 2rpx;
				height: 34rpx;
				background-color: rgba(0,0,0,0.3)!important;
			}
			.data{
				// margin-top: 52rpx;
			}
			.data-list-text{
				// font-weight: 500;
				color: #E6FEFF;

			}
		}
	}

	.goodsList{
		width: 633rpx;
		height: 696rpx;
		box-sizing: border-box;
		border: 0px solid #FFFFFF;
		background-color: rgba(0,0,0,0.39)!important;
		border-radius: 10rpx;
		margin: 0rpx 58rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		.goods-title{
			display: flex;
			justify-content: center;
			font-size: 28rpx;
			padding-top: 35rpx;
			padding-bottom: 31rpx;
			.goods-title-num{
			}
		}
		.goods-items{
			overflow-y: auto;
			.goods-item{
				
				width: 570rpx;
				// height: 154rpx;
				background: #FFFFFF;
				border: 0px solid #FFFFFF;
				border-radius: 10rpx;
				// box-sizing: border-box;
				padding: 12rpx;
				margin-bottom: 20rpx;
				display: flex;
				
				image{
					width: 130rpx;
					// height: 130rpx;
					height: 150rpx;
					background: linear-gradient(0deg, #F2F2FE 0%, #F3F3FF 100%);
					border-radius: 10rpx;
				}
				.goods-item-r{
					box-sizing: border-box;
					margin-left: 27rpx;
					margin-right: 27rpx;
					width: 374rpx;
					.goods-item-title{
						font-size: 26rpx;
						font-weight: 500;
						color: #000000;
					}
					.goods-item-price{
						text{
							color: #F51425;
							font-weight: bold;
							font-size: 32rpx;
						}
						
					}
				}
				
				
			}
		}
	}
	/deep/.exit,.header-box,.center,.goodsList,.footer-btn,.back-img{
		opacity: 0.9!important;
	}
</style>
